package scanner;

/**
 * Provides a representation for tokens identified
 * in the code file. Each token simply has
 * a value and type associated with it.
 * 
 * @author Dilan Manatunga
 *
 */
public class Token {
	/**
	 * The value of the token
	 */
	private String value;
	/**
	 * The type of the token
	 */
	private String type;
	private int lineNumber;
	/**
	 * The main constructor for Token which creates
	 * a Token with the inputed value and type.
	 * 
	 * @param value the string value for the token
	 * @param type the string type for the token
	 */
	public Token(String value, String type) {
		this.setValue(value);
		this.setType(type);
	}

	
	/**
	 * Returns a string representation of the Token
	 * of the token value and the type associated with
	 * said value.
	 * 
	 * @return the string representation of the Token
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return String.format("\"%s\" => %s", getValue(), getType());
	}


	public void setValue(String value) {
		this.value = value;
	}


	public String getValue() {
		return value;
	}


	public void setType(String type) {
		this.type = type;
	}


	public String getType() {
		return type;
	}
}
